# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=ark
pkgver=23.08.4
pkgrel=0
pkgdesc="Graphical file compression/decompression utility with support for multiple formats"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kde.org/applications/utilities/org.kde.ark"
license="GPL-2.0-only"
depends="
	7zip-virtual
	lrzip
	unzip
	zip
	zstd
	"
makedepends="
	extra-cmake-modules
	karchive5-dev
	kconfig5-dev
	kcrash5-dev
	kdbusaddons5-dev
	kdoctools5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	kitemmodels5-dev
	kparts5-dev
	kpty5-dev
	kservice5-dev
	kwidgetsaddons5-dev
	libarchive-dev
	libzip-dev
	qt5-qtbase-dev
	samurai
	shared-mime-info
	xz-dev
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/utilities/ark.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/ark-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

# secfixes:
#   20.08.0-r1:
#     - CVE-2020-24654
#   20.04.3-r1:
#     - CVE-2020-16116

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run -a ctest -E 'kerfuffle-mimetypetest'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
745c922c52192c61b80f928d4ffdbaee36c98b17d49308fa02daa27966753be5373af460efad1df75396b0cc534020e7873122faba5d83f76bfc1f0a68236be5  ark-23.08.4.tar.xz
"
